import os, sys
from subprocess import call, Popen, PIPE, STDOUT

def run_cmd(cmd):
    arglist = cmd.split()
    p = Popen(arglist, stdout=PIPE, stderr=STDOUT)
    output = p.communicate()[0]
    return (p.returncode, output)

def get_site_packages_path():
    for p in sys.path:
        (p1, p2) = os.path.split(p)
        if p2 == 'site-packages':
            return p
